home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993 April: Penguin on DISC / ADC Developer CD (1993-04) (''Penguin On DISC'')_iso / Dev.CD Apr 93.iso / Utilities / MPW Interfaces 7.1 Beta / AIncludes / Dictionary.a < prev    next >
Encoding:
Text File  |  1992-08-28  |  3.7 KB  |  135 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Dictionary.a
  3. ;
  4. ;    Contains:    xxx put contents here xxx
  5. ;
  6. ;    Written by:    xxx put writers here xxx
  7. ;
  8. ;    Copyright:    © 1992 by Apple Computer, Inc., all rights reserved.
  9. ;
  10. ;
  11.  
  12.     IF &TYPE('__INCLUDINGDICTIONARY__') = 'UNDEFINED' THEN
  13. __INCLUDINGDICTIONARY__    SET    1
  14.  
  15.     IF &TYPE('__INCLUDINGTRAPS__') = 'UNDEFINED' THEN
  16.                     INCLUDE 'Traps.a'
  17.     ENDIF
  18.  
  19.     IF &TYPE('__INCLUDINGFSEQU__') = 'UNDEFINED' THEN
  20.                     INCLUDE 'FSEqu.a'
  21.     ENDIF
  22.  
  23. ; Dictionary data insertion modes.
  24.  
  25. kInsert                 EQU     0            ; Only insert the input entry if there is nothing in the dictionary that matches the key.
  26. kReplace                 EQU     1            ; Only replace the entries which match the key with the input entry.
  27. kInsertOrReplace         EQU     2            ; Insert the entry if there is nothing in the dictionary which matches the key.
  28.                                             ; If there is already matched entries, replace the existing matched entries with the input entry.
  29. ; Key attribute constants.
  30.  
  31. kIsCaseSensitive            EQU        $10        ; case sensitive = 16.
  32. kIsNotDiacriticalSensitive    EQU        $20        ; diac not sensitive = 32.
  33.  
  34. ; Registered attribute type constants.
  35.  
  36. kNoun                    EQU        -1
  37. kVerb                    EQU        -2
  38. kAdjective                EQU        -3
  39. kAdverb                    EQU        -4
  40.  
  41. ; Dictionary information record type.
  42.  
  43. DictionaryInformation    RECORD      0,INCREMENT
  44. dictionaryFSSpec        DS            FSSpec            ; FSSpec record
  45. numberOfRecords            DS.L        1                ; long integer
  46. currentGarbageSize        DS.L        1                ; long integer
  47. script                    DS.W        1                 ; ScriptCode
  48. maximumKeyLength        DS.W        1                ; short integer
  49. keyAttributes            DS.B        1                ; unsigned byte
  50. padding                    DS.B        1                ; byte padding
  51. size                    EQU            *
  52.                           ENDR
  53.  
  54. ; Define the Dictionary Manager Dispatch trap opword
  55. _DictionaryDispatch        OPWORD      $AA53
  56.  
  57. ; Define the selector and the parameter size for each Dictionary Manager call.
  58. selectInitializeDictionary                    EQU    0
  59. paramWordsInitializeDictionary                EQU    5 
  60.  
  61. selectOpenDictionary                        EQU    1
  62. paramWordsOpenDictionary                    EQU    5
  63.  
  64. selectCloseDictionary                        EQU    2
  65. paramWordsCloseDictionary                    EQU    2
  66.  
  67. selectInsertRecordToDictionary                EQU    3
  68. paramWordsInsertRecordToDictionary            EQU    7
  69.  
  70. selectDeleteRecordFromDictionary            EQU    4
  71. paramWordsDeleteRecordFromDictionary        EQU    4
  72.  
  73. selectFindRecordInDictionary                EQU    5
  74. paramWordsFindRecordInDictionary            EQU    8
  75.  
  76. selectFindRecordByIndexInDictionary            EQU    6
  77. paramWordsFindRecordByIndexInDictionary        EQU    10
  78.  
  79. selectGetDictionaryInformation                EQU    7
  80. paramWordsGetDictionaryInformation            EQU    4
  81.  
  82. selectCompactDictionary                        EQU    8
  83. paramWordsCompactDictionary                    EQU    2
  84.  
  85. ; Define the dispatch macros to get to the calls.
  86.  
  87.     MACRO
  88.     _InitializeDictionary
  89.         DoDispatch _DictionaryDispatch, selectInitializeDictionary, paramWordsInitializeDictionary
  90.     ENDM
  91.     
  92.     MACRO
  93.     _OpenDictionary
  94.         DoDispatch _DictionaryDispatch, selectOpenDictionary, paramWordsOpenDictionary
  95.     ENDM
  96.     
  97.     MACRO
  98.     _CloseDictionary
  99.         DoDispatch _DictionaryDispatch, selectCloseDictionary, paramWordsCloseDictionary
  100.     ENDM
  101.     
  102.     MACRO
  103.     _InsertRecordToDictionary
  104.         DoDispatch _DictionaryDispatch, selectInsertRecordToDictionary, paramWordsInsertRecordToDictionary
  105.     ENDM
  106.     
  107.     MACRO
  108.     _DeleteRecordFromDictionary
  109.         DoDispatch _DictionaryDispatch, selectDeleteRecordFromDictionary, paramWordsDeleteRecordFromDictionary
  110.     ENDM
  111.     
  112.     MACRO
  113.     _FindRecordInDictionary
  114.         DoDispatch _DictionaryDispatch, selectFindRecordInDictionary, paramWordsFindRecordInDictionary
  115.     ENDM
  116.     
  117.     MACRO
  118.     _FindRecordByIndexInDictionary
  119.         DoDispatch _DictionaryDispatch, selectFindRecordByIndexInDictionary, paramWordsFindRecordByIndexInDictionary
  120.     ENDM
  121.     
  122.     MACRO
  123.     _GetDictionaryInformation
  124.         DoDispatch _DictionaryDispatch, selectGetDictionaryInformation, paramWordsGetDictionaryInformation
  125.     ENDM
  126.     
  127.     MACRO
  128.     _CompactDictionary
  129.         DoDispatch _DictionaryDispatch, selectCompactDictionary, paramWordsCompactDictionary
  130.     ENDM
  131.  
  132.  
  133.  
  134.     ENDIF    ; ...already included 
  135.